package com.unione.cloud.demo.job;

import org.springframework.stereotype.Component;

import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;

import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j;



@Slf4j
@Component
public class XxlJobHandler {



    @XxlJob("unione-demo-time-print")
    public void timePrint() {
        log.info("===============================");
        log.info("job trigger time print {}",DateUtil.now());
        log.info("job id: {}", XxlJobHelper.getJobId());
        log.info("job params: {}", XxlJobHelper.getJobParam());
        log.info("job shard index: {}", XxlJobHelper.getShardIndex());
        log.info("job shard total: {}", XxlJobHelper.getShardTotal());
        log.info("===============================");
    }


}
